Overview
Thepricehistory endpoint requires Steam session cookies to authenticate requests. This is the only endpoint that requires authentication - all other endpoints (priceoverview, itemordershistogram, itemordersactivity) work without authentication.
Why Authentication is Required
Steam restricts access to historical price data to logged-in users only. Thepricehistory endpoint returns years of hourly price and volume data, which Steam considers sensitive market information.
Required Cookies
You need to extract these cookies from your browser while logged into Steam:Your Steam session identifier. This is the primary authentication token.Format: 32-character hexadecimal stringExample:
a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6Your Steam login secure token. Contains your Steam ID and authentication signature.Format:
{steamid64}||{auth_token}Example: 76561198012345678||A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Browser identifier (optional but recommended).Format: Long numeric stringExample:
1234567890123456789Steam country code (optional).Format:
{country_code}|{hash}Example: US|a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6Setup Instructions
Step 1: Log into Steam
- Open your web browser
- Navigate to https://steamcommunity.com
- Log in with your Steam account
- Navigate to any market listing page to ensure you’re fully authenticated
Step 2: Extract Cookies
Chrome / Edge / Brave
- Press
F12to open Developer Tools - Click the Application tab (or Storage in some browsers)
- In the left sidebar, expand Cookies
- Click on
https://steamcommunity.com - Find and copy the values for:
sessionidsteamLoginSecurebrowserid(optional)steamCountry(optional)
Firefox
- Press
F12to open Developer Tools - Click the Storage tab
- In the left sidebar, expand Cookies
- Click on
https://steamcommunity.com - Find and copy the values for:
sessionidsteamLoginSecurebrowserid(optional)steamCountry(optional)
Safari
- Enable Developer menu: Preferences → Advanced → Show Develop menu
- Press
⌘ + ⌥ + Ito open Developer Tools - Click the Storage tab
- Expand Cookies →
https://steamcommunity.com - Find and copy the values for the required cookies
Step 3: Create .env File
In your project root directory (same location asconfig.yaml), create a file named .env:
Step 4: Verify Setup
Add apricehistory item to your config.yaml:
How It Works
The authentication system (fromsteamAPIclient.py:fetch_price_history):
- Loads cookies from .env on each request (supports hot-swapping)
- Builds cookie dictionary with available values
- Sends cookies with request along with browser-like headers
- Steam validates cookies and returns historical data
Cookie Lifespan
Steam session cookies typically expire after:- sessionid: ~2 weeks of inactivity
- steamLoginSecure: ~1 year or until you log out
Signs Your Cookies Expired
pricehistoryrequests start failing with errors- Empty response data (
{"success": false}) - HTTP 401 Unauthorized or 403 Forbidden responses
Refreshing Expired Cookies
- Log out of Steam in your browser
- Log back in
- Extract the new cookie values (follow Step 2 above)
- Update your
.envfile - No need to restart Hridaya (hot-swapping will pick up new values)
Security Best Practices
Protect Your Cookies
- Never share your
.envfile or cookie values - Add to .gitignore:
- Restrict file permissions:
- Use a dedicated Steam account (optional but recommended for automated systems)
- Rotate regularly: Log out and back in periodically to refresh tokens
What Someone Can Do With Your Cookies
- Access your Steam profile
- View your inventory
- Make trades (if Steam Guard is disabled)
- Access your market activity
- View your purchase history
Troubleshooting
Error: “pricehistory request failed”
Cause: Missing or invalid cookies Solution:- Verify
.envfile exists in project root - Check that
sessionidandsteamLoginSecureare set - Re-extract cookies (they may have expired)
- Ensure you’re logged into Steam in your browser
Error: Empty response data
Cause: Expired session Solution:- Log out of Steam
- Log back in
- Extract fresh cookies
- Update
.env
Error: “success”: false
Cause: Invalid item or authentication issue Solution:- Verify the
market_hash_nameis correct - Check that the item exists on Steam market
- Confirm cookies are valid (try accessing market in browser)
Cookies work in browser but not in Hridaya
Cause: Additional security headers required Solution: The system already includes proper headers (steamAPIclient.py:226-229):
- Check your firewall isn’t blocking requests
- Ensure your IP isn’t rate-limited by Steam
- Try using a VPN if your region is restricted
Alternative: Using Developer Tools Network Tab
If you’re having trouble finding cookies:- Open Developer Tools (
F12) - Go to Network tab
- Navigate to a Steam market listing page
- Find a request to
pricehistory - Click on it → Headers → Request Headers
- Copy the entire
Cookieheader value - Parse out the individual cookie values:
Example .env Template
Copy this template and fill in your values:Next Steps
API Endpoints
Learn about all four Steam API endpoints
Config Reference
Complete configuration parameter reference
Quickstart
Get started with basic configuration